using I2.Loc;
using UnityEngine;

public class TDMColorScroll : MonoBehaviour
{
	[SerializeField]
	private Color zombieColor;

	[SerializeField]
	private Color humanColor;

	[SerializeField]
	private UISprite[] ourTeamSprite;

	[SerializeField]
	private UISprite[] enemyTeamSprite;

	[SerializeField]
	private UILabel lbBlue;

	[SerializeField]
	private UILabel lbRed;

	public static TDMColorScroll instance;

	private void Awake()
	{
		instance = this;
		ChangeColorTeam();
	}

	private void OnEnable()
	{
		ChangeColorTeam();
	}

	public void ChangeColorTeam()
	{
		if (GameController.instance.curTypeGame != TypeGame.Zombe)
		{
			return;
		}
		lbBlue.GetComponent<Localize>().enabled = false;
		lbRed.GetComponent<Localize>().enabled = false;
		if (TDMController.myTeam == PunTeams.Team.blue)
		{
			UISprite[] array = ourTeamSprite;
			foreach (UISprite uISprite in array)
			{
				uISprite.color = humanColor;
			}
			UISprite[] array2 = enemyTeamSprite;
			foreach (UISprite uISprite2 in array2)
			{
				uISprite2.color = zombieColor;
			}
			lbBlue.text = ScriptLocalization.Get("Game_Common/sm_zombie_hm");
			lbRed.text = ScriptLocalization.Get("Game_Common/sm_zombie_zb");
		}
		else
		{
			UISprite[] array3 = ourTeamSprite;
			foreach (UISprite uISprite3 in array3)
			{
				uISprite3.color = zombieColor;
			}
			UISprite[] array4 = enemyTeamSprite;
			foreach (UISprite uISprite4 in array4)
			{
				uISprite4.color = humanColor;
			}
			lbBlue.text = ScriptLocalization.Get("Game_Common/sm_zombie_zb");
			lbRed.text = ScriptLocalization.Get("Game_Common/sm_zombie_hm");
		}
	}
}
